//
//  HelpScene.m
//  iSuDoku
//
//  Created by maccctk on 09-7-6.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "HelpScene.h"
#import "MenuScene.h"

@implementation HelpScene

- (id)init {
	self = [super init];
	if(self != nil) {
		[self addChild:[HelpLayer node] z:0];
	}
	return self;
}

@end

@implementation HelpLayer

- (id)init {
	self = [super init];
	if(self != nil) {
		isTouchEnabled = YES;
		
		Sprite *bg = [Sprite spriteWithFile:@"game.png"];
		[bg setPosition:ccp(240, 160)];
		[self addChild:bg z:0];
		
		Label *label = [Label labelWithString:
						@"iSoDoKu\n"
						"\n"
						"The Sodoku puzzle is a Japanese logic game which entered the western world in the last "
						"few months and is gaining popularity very fast. "
						"Sodoku will require logic on your side, and will develop your logical thinking and decision making, "
						"especially in the harder Sodoku boards.\n"
						"\n"
						"rules:\n"
						"Fill in the grid so that every row, every column, and every 3x3 box contains the digits 1 through 9.\n"
						"\n"
						"Tips:\n"
						"1. Make sure you have some free time ahead.\n"
						"2. Resist the temptation of guess and use logic instead!\n"
						"3. Solving time for the Sodoku is typically from 10 to 30 minutes, depending on your Sodoku skill and experience, "
						"so don't quit if you're Sodoku-ing for 5 mins and getting nowhere.\n"
						"\n"
						"Now start game to enjoy it!"
								   dimensions: CGSizeMake(400, 320)
									alignment: UITextAlignmentLeft
									 fontName:@"Helvetica" fontSize:11];
		[label setPosition:ccp(240, 140)];
		[label setRGB:0 :0 :0];
		[self addChild:label z:0];
	}
	return self;
}

- (BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
	MenuScene *ms = [MenuScene node];
	[[Director sharedDirector] replaceScene:ms];	
	return YES;
}

@end